<link rel="stylesheet" href="__PUBLIC__/media/kindeditor-4.1.7/themes/default/default.css" />
<link rel="stylesheet" href="__PUBLIC__/media/kindeditor-4.1.7/themes/simple/simple.css" />
<link rel="stylesheet" href="__PUBLIC__/app/css/article_articleUploads.css" />
<script charset="utf-8" src="__PUBLIC__/media/kindeditor-4.1.7/kindeditor-min.js"></script>
<script charset="utf-8" src="__PUBLIC__/media/kindeditor-4.1.7/lang/zh_CN.js"></script>
<script>
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('#article_edit', {
			allowFileManager: true,
			themeType: 'simple',
			width: '100%',
			height:'320px',
			resizeType:1,
			afterBlur: function() {
				this.sync();
			},
			autoHeightMode : true,
			afterCreate : function() {
				this.loadPlugin('autoheight');
			}
		});
	});
</script>
<div class="row-fluid">

	<div class="span12">

		<!-- BEGIN STYLE CUSTOMIZER -->

		<div class="color-panel hidden-phone">
			
			<h3 class="page-title"><i class="icon-cogs"></i>文章修改</h3>
			<ul class="breadcrumb">

				<li>

					<i class="icon-picture"></i>

					<a href="{:U('Article/articleUploads')}">文章上传</a> 

					<i class="icon-tags"></i>

				</li>

				<li>

					<a href="{:U('Article/articleList')}">文章列表</a>

				</li>

			</ul>
		</div>
		<div class="form_input">
			<form id="article_edit_form"  action="{:U('Article/reviseArticleSave?id='.$reviseArticle[0]['Id'])}" method="post" enctype="multipart/form-data" class="form-horizontal form">
				
				<input type="text" placeholder="title" name="title" class="span12 article_title" value="{$reviseArticle[0]['title']}">
				<br>
				<textarea placeholder="content" id="article_edit" name="article_edit" class="span11 m-wrap">
				{$reviseArticle[0]['content']}
				</textarea>
				<div class="control-group">

					<label class="control-label">上传图片</label>

					<div class="controls">

						<input class="default" type="file" name="article_img">

					</div>

					<label class="control-label">文章类型</label>
					<div class="controls">
						<select data-placeholder="请选择文章类型" class="chosen-with-diselect span6" tabindex="-1" name="type">
							<option value="web">web case</option>
							<option value="interface">interface</option>
							<option value="logo">logo</option>
							<option value="media">media</option>
						</select>
					</div>
					<label class="control-label">推荐值</label>
					<div class="controls">
						<input type="number" name="recommended" value="{$reviseArticle[0]['recommended']}" max="5" min="1" />
					</div>
				</div>
				<button class="btn blue btn-block" type="button" id="btn_form">提交<i class="m-icon-swapright m-icon-white"></i></button>
			</form>
		</div>
	</div>
</div>
		
		
<script type="text/javascript">
	$(function(){
		var edit=$("#article_edit");
		var btn=$("#btn_form");
		btn.click (function(){
			if(edit.val()!=""){
					$("#article_edit_form").submit();
				}
				
			else{
				alert();
				}
			});
		var type="<?php echo $reviseArticle[0]['type'] ?>";
		$("option[value='"+type+"']").attr("selected","selected");
	});
</script>
